package com.dqs.service.serviceimpl;

import com.dqs.mapper.EmployeeMapper;
import com.dqs.po.EmployeePo;
import com.dqs.service.EmployeeService;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EmployeeServiceImpl implements EmployeeService {
    @Autowired
    private EmployeeMapper employeeMapper;

    @Override
    public int deleteEmployeePo(Integer id) {
        return employeeMapper.deleteEmployeePo(id);
    }

    @Override
    public List<EmployeePo> selectEmployeePo(Integer employeeWorkId, String employeeName, String employeeAddress) {

        PageHelper.startPage(1, 10);
        return employeeMapper.selectEmployeePo(employeeWorkId, employeeName, employeeAddress);
    }

    @Override
    public int insertEmployeePo(EmployeePo employeePo) {
        return employeeMapper.insertEmployeePo(employeePo);
    }

    @Override
    public int updateEmployeeById(EmployeePo employeePo) {
        return employeeMapper.updateEmployeeById(employeePo);
    }
}

